package com.ybb.production.mapper;

import com.alibaba.fastjson2.JSONObject;
import com.ybb.production.domain.GarmentProductionBianfei;
import com.ybb.production.domain.GarmentProductionUpnumberRecord;
import com.ybb.production.dto.GarmentProductionPayDetailParam;
import com.ybb.production.responce.GarmentBianfeiSumResp;
import com.ybb.production.responce.GarmentPayDetailResp;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 编菲信息Mapper接口
 *
 * @author dengjie
 * @date 2023-09-09
 */
public interface GarmentProductionBianfeiMapper {
    /**
     * 查询编菲信息
     *
     * @param id 编菲信息主键
     * @return 编菲信息
     */
    public GarmentProductionBianfei selectGarmentProductionBianfeiById(Long id);

    /**
     * 查询编菲信息列表
     *
     * @param garmentProductionBianfei 编菲信息
     * @return 编菲信息集合
     */
    public List<GarmentProductionBianfei> selectGarmentProductionBianfeiList(GarmentProductionBianfei garmentProductionBianfei);

    /**
     * 新增编菲信息
     *
     * @param garmentProductionBianfei 编菲信息
     * @return 结果
     */
    public int insertGarmentProductionBianfei(GarmentProductionBianfei garmentProductionBianfei);

    /**
     * 修改编菲信息
     *
     * @param garmentProductionBianfei 编菲信息
     * @return 结果
     */
    public int updateGarmentProductionBianfei(GarmentProductionBianfei garmentProductionBianfei);

    /**
     * 删除编菲信息
     *
     * @param id 编菲信息主键
     * @return 结果
     */
    public int deleteGarmentProductionBianfeiById(Long id);

    /**
     * 批量删除编菲信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteGarmentProductionBianfeiByIds(Long[] ids);

    List<Map<String, Object>> selectQuantityByOrderIds(@Param("orderIds") List<Long> orderIds);

    void deleteGarmentProductionBianfeiByCuttingBedIds(@Param("cuttingBedIds") Long[] cuttingBedIds);

    List<Map<String, Object>> selectGarmentProductionBianfeiListByCuttingId(@Param("cuttingIds") Set<Long> cuttingIds);

    List<GarmentProductionBianfei> selectGarmentProductionBianfeiListByBundleNos(@Param("bundleNos") List<GarmentProductionUpnumberRecord> bundleNos);

    List<Map<String, Object>> selectBianfieGroup(@Param("id") Long id, @Param("processCnt") int processCnt);

    int qrySumBianfeiQuilty(@Param("allIds") List<String> allIds);

    void batchInsert(@Param("insertList") List<GarmentProductionBianfei> insertList);

    List<Long> selectGarmentProductionBianfeiListByProcessIds(@Param("lastProcessIds") List<Long> lastProcessIds);

    List<GarmentProductionBianfei> qryBianFeiSum(@Param("cuttingIds") List<Long> cuttingIds, @Param("processId") List<Long> processId);

    List<Map<String, Object>> qryCompleteProcessCnt(@Param("cuttingIds") Set<Long> cuttingIds);

    List<GarmentBianfeiSumResp> qryTotalAndCompleteByCuttingBedIds(@Param("cuttingBedIds") List<Long> bedIds, @Param("lastProcessId") Long lastProcessId);

    List<GarmentBianfeiSumResp> qryGroupByProcess(@Param("cutBedIds") List<Long> cutBedIds);

    List<GarmentProductionBianfei> selectListByIds(@Param("ids") String ids);

    int editUpNumCancel(@Param("ids") String ids);

    List<GarmentBianfeiSumResp> qryBianFeiProcessByOrderId(@Param("orderId") Long orderId);

    void deleteBianfeiByProcessIds(@Param("extraElements") List<Long> extraElements);

    Integer qryRemainingUpNums(GarmentProductionBianfei bianfei);

    int qryAllCuttingBedCnt();

    List<GarmentProductionBianfei> qryListSingle(GarmentProductionBianfei bianfei);

    void deleteBianfeiByOrderIds(Long[] ids);

    List<Map<String, String>> qryCntSalaryByUserIds(JSONObject param);

    List<GarmentPayDetailResp> qryPayDetail(GarmentProductionPayDetailParam detailParam);

    void updatePayStatus(JSONObject param);
}
